import os
import time

topics = [  "memtest",
            "bcc",
            "racoon",
            "patchoat",
            "screencap",
            "run-as",
            "mediametrics",
            "arping",
            "e2fsdroid",
            "secdiscard",
            "incident",
            "cmd",
            "profman",
            "ndc",
            "sensorservice",
            "bootstat",
            "bootanimation",
            "vdc",
            "tc",
            "fsck.f2fs",
            "cameraserver",
            "blank_screen",
            "iotop",
            "sqlite3",
            "lmkd",
            "strace",
            "atrace",
            "wait_for_keymaster",
            "vr_hwc",
            "ip",
            "dexoptanalyzerd",
            "dnsmasq",
            "memory_replay32",
            "dumpstate",
            "mdnsd",
            "installd",
            "gatekeeperd",
            "sdcard",
            "crash_dump32",
            "fsck_msdos",
            "hwservicemanager",
            "sload_f2fs",
            "mediaextractor",
            "dex2oatd",
            "perfetto",
            "patchoatd",
            "reboot",
            "iw",
            "toybox",
            "profmand",
            "thermalserviced",
            "mediaserver",
            "drmserver",
            "healthd",
            "oatdump",
            "traced",
            "audioserver",
            "logcat",
            "resize2fs",
            "debuggerd",
            "uncrypt",
            "mke2fs",
            "app_process32",
            "vold",
            "mediadrmserver",
            "service",
            "dexdump",
            "tune2fs",
            "schedtest",
            "ping6",
            "perfprofd",
            "make_f2fs",
            "ping",
            "traceroute6",
            "ld.mc",
            "incidentd",
            "blkid",
            "libdisplayservicehidl",
            "libsysutils",
            "libbinderwrapper",
            "libhardware",
            "libtpm_manager",
            "android.hardware.camera.device@3.2",
            "libwilhelm",
            "android.hardware.health@1.0",
            "libimg_utils",
            "libvixld-arm64",
            "libbpf",
            "libvndksupport",
            "libext2_uuid",
            "libopenjdkjvm",
            "libspeexresampler",
            "libwifi-service",
            "libstagefright_soft_hevcdec",
            "libprotobuf-cpp-lite",
            "libstagefright_soft_mpeg4enc",
            "libstagefright_soft_flacenc",
            "android.hardware.thermal@1.1",
            "libsoundtriggerservice",
            "libpowermanager",
            "libappfuse",
            "libexif",
            "libldacBT_abr",
            "libGLESv3",
            "libbrotli",
            "libadbconnection",
            "android.hardware.tetheroffload.config@1.0",
            "libRS",
            "librtp_jni",
            "libaaudio",
            "libcrypto_utils",
            "android.hardware.vr@1.0",
            "libhwui",
            "android.hardware.memtrack@1.0",
            "android.hardware.neuralnetworks@1.1",
            "libhidcommand_jni",
            "android.system.net.netd@1.0",
            "libjni_latinime",
            "android.hardware.renderscript@1.0",
            "android.hardware.bluetooth@1.0",
            "libhwbinder",
            "libjni_jpegstream",
            "libcrypto",
            "liblogcat",
            "libtextclassifier",
            "libwifi-system-iface",
            "libRSDriver",
            "libmediandk",
            "android.hardware.contexthub@1.0",
            "drm/libfwdlockengine",
            "libpcre2",
            "android.hardware.nfc@1.1",
            "libstagefright_soft_aacenc",
            "extractors/liboggextractor",
            "extractors/libmkvextractor",
            "extractors/libmp4extractor",
            "extractors/libmpeg2extractor",
            "extractors/libamrextractor",
            "extractors/libwavextractor",
            "extractors/libmp3extractor",
            "extractors/libaacextractor",
            "extractors/libflacextractor",
            "extractors/libmidiextractor",
            "libpdx_default_transport",
            "android.hidl.memory@1.0",
            "android.system.wifi.keystore@1.0",
            "libdl",
            "libstagefright_soft_aacdec",
            "libdexfiled",
            "libnpt",
            "libwfds",
            "android.hardware.audio.effect@2.0",
            "android.hardware.confirmationui@1.0",
            "libmtp",
            "libaudioprocessing",
            "libnetlink",
            "libdexfile",
            "android.hardware.power@1.1",
            "libwebviewchromium_plat_support",
            "libaudiomanager",
            "libRS_internal",
            "libbrillo",
            "liblshal",
            "libnetd_client",
            "libunwindstack",
            "libbootanimation",
            "libdumpstateutil",
            "libhidlbase",
            "libRSCacheDir",
            "libopus",
            "libfmq",
            "android.hidl.allocator@1.0",
            "libjpeg",
            "libtombstoned_client",
            "libmemtrack",
            "libtinyxml2",
            "libnblog",
            "libpac",
            "libselinux",
            "libstagefright_omx",
            "android.hardware.dumpstate@1.0",
            "android.hardware.neuralnetworks@1.0",
            "libstagefright_omx_utils",
            "libmidi",
            "android.hardware.graphics.composer@2.1",
            "libharfbuzz_ng",
            "libbluetooth",
            "libsurfaceflinger",
            "android.hardware.soundtrigger@2.1",
            "android.hardware.audio.effect@4.0",
            "libstagefright_xmlparser",
            "android.hardware.graphics.common@1.1",
            "libandroidfw",
            "libstagefright_amrnb_common",
            "libutils",
            "libext2_blkid",
            "android.hardware.light@2.0",
            "android.hardware.ir@1.0",
            "libhidl-gen-hash",
            "liblzma",
            "libmedia_omx",
            "libminijail",
            "libstagefright",
            "liblogwrap",
            "libRSCpuRef",
            "libstdc++",
            "libwebviewchromium_loader",
            "android.hardware.power@1.2",
            "android.hardware.camera.provider@2.4",
            "libext2_misc",
            "libstagefright_soft_amrwbenc",
            "libkeymaster_messages",
            "libstagefright_http_support",
            "libgraphicsenv",
            "android.hardware.bluetooth.a2dp@1.0",
            "libpng",
            "libvixld-arm",
            "libsurfaceflinger_ddmconnection",
            "libserviceutility",
            "libandroid_servers",
            "libnativeloader",
            "android.hardware.tv.input@1.0",
            "libbrillo-minijail",
            "libstagefright_bufferqueue_helper",
            "libservices",
            "libkeymaster_portable",
            "libsqlite",
            "libdumpstateaidl",
            "libopenjdkjvmd",
            "libradio_metadata",
            "libui",
            "libsensorservice",
            "libstagefright_soft_opusdec",
            "libkeymaster4support",
            "android.hardware.graphics.mapper@2.1",
            "libaudiopolicyenginedefault",
            "android.frameworks.sensorservice@1.0",
            "libOpenMAXAL",
            "libstagefright_soft_mp3dec",
            "libneuralnetworks",
            "libkeyutils",
            "libart-disassembler",
            "libmediadrm",
            "libmedia2_jni",
            "android.hardware.camera.common@1.0",
            "libpixelflinger",
            "libeffectsconfig",
            "libnfc_nci_jni",
            "android.hardware.camera.device@1.0",
            "android.hardware.cas.native@1.0",
            "libmedia_jni",
            "libstagefright_flacdec",
            "libdebuggerd_client",
            "libtrunks",
            "libmdnssd",
            "libaudioclient",
            "libprocinfo",
            "libnfc-nci",
            "libGLESv1_CM",
            "libpower",
            "android.hardware.usb.gadget@1.0",
            "libaudiohal",
            "android.hardware.cas@1.0",
            "libext4_utils",
            "libopenjdk",
            "libjni_tinyplanet",
            "libsuspend",
            "libstagefright_soft_vorbisdec",
            "invoke_mock_media_player",
            "android.hardware.audio@2.0",
            "libopenjdkjvmtid",
            "android.hardware.audio.common@4.0",
            "libEGL",
            "libschedulerservicehidl",
            "wificond",
            "keystore_cli_v2",
            "grep",
            "bpfloader",
            "screenrecord",
            "adbd",
            "toolbox",
            "tombstoned",
            "servicemanager",
            "tracepath6",
            "bzip2",
            "lshal",
            "tracepath",
            "dexdiag",
            "dexoptanalyzer",
            "logwrapper",
            "incident_helper",
            "dexlist",
            "bugreport",
            "keystore",
            "vold_prepare_subdirs",
            "applypatch",
            "iptables",
            "logcatd",
            "mtpd",
            "sh",
            "netd",
            "ip6tables",
            "surfaceflinger",
            "dex2oat",
            "awk",
            "usbd",
            "linker",
            "netutils-wrapper-1.0",
            "dalvikvm32",
            "storaged",
            "secilc",
            "ss",
            "sgdisk",
            "idmap",
            "tzdatacheck",
            "dumpsys",
            "vintf",
            "bugreportz",
            "logd",
            "clatd",
            "traced_probes",
            "pppd",
            "e2fsck",
            "statsd"]

msgs = ["\"Test_msg:0:hello\"",
        "\"Test_msg:1:this my msg\"",
        "\"Test_msg:2:where are you\"",
        "\"Test_msg:3:who am i\"",
        "\"Test_msg:4:10086\"",
        "\"Test_msg:5:PersistentTest msg\"",
        "\"Test_msg:6:conected\"",
        "\"Test_msg:7:abort now?\"",
        "\"Test_msg:8:new msg alert\"",
        "\"Test_msg:9:chiper text:AAAAB3NzaC1yc2EAAAADAQABAAACAQDF+axF0gxIEupxl7ce1QMoKYpOPBpIPP2Sg9RJugt9RmcJOYHCpIcnsfWDu3ROovvNLmFFrz0iLFAynEiJCM8wdiIFEYn4IG4h4RO9gV2DnYXvX54iPhx4v1XeNDOmJCakO/f4SXxS43IIFKaeIO8YlrxNdVxCFtPFw1TjRql8NXGNHr7B7bqKdsfaZRvWBWe1WzF7B9IKsVSUlFSOuj6YIcDn58fpLkgBRkE0Au1mRXNTIbo+JirWRDvQshBeuR6TiE/GcPVuLfFnJRIUUPuxkH1m/Uty0Dox1HXTM5UrfCQLhSL5sdY84JYM59vQxYrBwcXaw0wboOpRcfW2HjYOjUqAvGbZHdQL7ue/VXiuddeZ9NXo+Ju45gnwb+7Dyqb1LwCzG7Q7EM0jja+EMQ1nbVhzckmxJbc7OdnNj7lUwY4EXr54UT7r11EFK3C9EkRbRRSi5jY5KwRRQWeN4AArHKLjusDOpR9jmdd5J/iUhhnnCxiooANOo2VQCOyuy4FlpI2hOuxPYOOSHPaxXJdjzwy4aj18EH0NnedeVElB75bm7F+ojYwuIRk/G+Si4hXmI/QqKyYZ2KiJcA19dNxKQIglD2DbtpQLbOyXO99Ot+qjEsq2H4YXuP+Go1kzaKAUQvsHfaHGzAcER9mFTrDVeHhiE5bMhMEFo6yiP17QGw\""]


for topic in topics:
    current_topic = " -t " + topic
    for msg in msgs:
        cmd = ""
        cmd +=  "mosquitto_pub "
        cmd +=  " -t " + topic
        cmd +=  " -m " + msg 
        cmd +=  " -i localhost "
        print(cmd)
        os.system(cmd)
        



